package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.StrategyQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface StrategyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Strategy record);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> selectAll(@Param("state") Integer state);

    int updateByPrimaryKey(Strategy record);

    List<Strategy> selectForList(StrategyQueryObject qo);

    void addFavorite(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    void removeFavorite(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    Strategy selectMyFavorite(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    void updateAddFavoriteCount(Long strategyId);

    void updateRemoveFavoriteCount(Long strategyId);

    void updateReadCount(Long strategyId);

    Strategy selectTravelList(@Param("strategyId") Long strategyId, @Param("userId") Long userId);

    void addTravelList(@Param("strategyId") Long strategyId, @Param("userId") Long userId, @Param("createTime") Date createTime);

    void removeTravelList(@Param("strategyId") Long strategyId, @Param("userId") Long userId);
}